<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserLoginLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_login_logs', function (Blueprint $table) {
            $table->id()->comment('用户登录日志表');
            $table->integer('user_id')->comment('用户id')->index();
            $table->string('login_ip')->comment('用户登录ip');
            $table->string('type')->comment('登录类型 PC:电脑端 APP:APP Applet:小程序 H5:H5');
            $table->string('equipment_id')->nullable()->comment('用户登录设备id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_login_logs');
    }
}
